﻿using System;
using FactoryPattern.Models;

namespace FactoryPattern.Simple
{
    public class SimpleFactory
    {
        /// <summary>
        /// 获取需要的类型
        /// </summary>
        public static IGirlFriend GetGirlFriend(Country country)
        {
            switch (country)
            {
                case Country.American:
                    return new American();
                case Country.Chinese:
                    return new Chinese();
                case Country.Japanese:
                    return new Japanese();
                default:
                    throw new Exception("爱上一匹野马,可我的家里没有草原. 你走吧！");
            }
        }
    }

    /// <summary>
    /// 国家
    /// </summary>
    public enum Country
    {
        American,
        Japanese,
        Chinese
    }
}
